<template>
  <a-layout id="components-layout-demo-custom-trigger">
    <a-layout-sider v-model="collapsed" :trigger="null" collapsible>
      <div v-if="logo" class="logo">
        <p>{{ title }}</p>
      </div>
      <a-menu theme="dark" mode="inline" :default-selected-keys="['0']">
        <a-menu-item key="0">
          <router-link to="/home">
            <a-icon type="user" />
            <span>个人信息</span>
          </router-link>
        </a-menu-item>
   <!-- <a-menu-item key="1">
          <router-link to="/home/1">
            <a-icon type="user" />
            <span>静态传参</span>
          </router-link>
        </a-menu-item>
        <a-menu-item key="2">
          <router-link to="/home/2/123">
            <a-icon type="video-camera" />
            <span>动态传参</span>
          </router-link>
        </a-menu-item>
        <a-menu-item key="3">
          <router-link to="/home/3/我是动态参数">
            <a-icon type="upload" />
            <span>混合传参</span>
          </router-link>
        </a-menu-item>
        <a-menu-item key="4">
          <router-link to="/home/随便填">
            <a-icon type="upload" />
            <span>无页面</span>
          </router-link>
        </a-menu-item>  -->
	<a-menu-item key="1">
          <router-link to="/home/5/请假申请">
            <a-icon type="mail" />
            <span>请假申请</span>
          </router-link>
        </a-menu-item>
	<a-menu-item key="2">
          <router-link to="/home/6/假期余额">
            <a-icon type="search" />
            <span>假期余额</span>
          </router-link>
        </a-menu-item>
	<a-menu-item key="3">
          <router-link to="/home/8/每月报表">
            <a-icon type="container" />
            <span>每月报表</span>
          </router-link>
        </a-menu-item>
	<a-menu-item key="4">
          <router-link to="/home/9/员工信息">
            <a-icon type="team" />
            <span>员工信息</span>
          </router-link>
        </a-menu-item>
	<a-menu-item key="5">
          <router-link to="/home/7/请假审批">
            <a-icon type="carry-out" />
            <span>请假审批</span>
          </router-link>
        </a-menu-item>
	<a-menu-item key="6">
          <router-link to="/home/10/请假记录">
            <a-icon type="solution" />
            <span>请假记录</span>
          </router-link>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">
        <a-icon
          class="trigger"
          :type="collapsed ? 'menu-unfold' : 'menu-fold'"
          @click="() => (collapsed = !collapsed)"
        />
      </a-layout-header>
      <a-layout-content
        :style="{
          margin: '24px 16px',
          padding: '24px',
          background: '#fff',
          minHeight: '280px',
        }"
      >
        <router-view></router-view>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>
<script>
import { mapGetters, mapState, mapActions, mapMutations } from "vuex";
import { SET_TITLE, SET_LOGO, SET_USERINFO } from "@/types/mutation-types";
export default {
  data() {
    return {
      collapsed: false,
    };
  },
  computed: {
    ...mapGetters(["logo"]), //采用Getter获取状态
    ...mapState("settings", ["title"]), //采用mapState获取状态
  },
};
</script>
<style>
#components-layout-demo-custom-trigger {
  height: 100%;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 20px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}

#components-layout-demo-custom-trigger .trigger:hover {
  color: #1890ff;
}

#components-layout-demo-custom-trigger .logo {
  height: 32px;
  background: rgba(255, 255, 255, 0.5);
  margin: 10px;
}
p{
  font-size: 20px;
  padding: 0 30px;
}
</style>